package com.xyh.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xyh.common.to.mq.OrderTo;
import com.xyh.common.to.mq.StockLocked;
import com.xyh.common.utils.PageUtils;
import com.xyh.gulimall.ware.entity.WareSkuEntity;
import com.xyh.gulimall.ware.vo.LockStockResult;
import com.xyh.gulimall.ware.vo.SkuHasStockVo;
import com.xyh.gulimall.ware.vo.WareSkuLockVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author chenshun
 * @email 1005074582@qq.com
 * @date 2022-12-15 23:14:09
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    List<SkuHasStockVo> getSkusHasStock(List<Long> skuIds);

    Boolean orderLockStock(WareSkuLockVo vo);

    void unLockStock(StockLocked to);

    void unLockStock(OrderTo to);
}

